package com.logos.musicframe.service;

import com.logos.musicframe.entity.PlaylistCollected;
import com.logos.musicframe.req.PlaylistCollectedReq;
import com.logos.musicframe.resp.PlaylistResp;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;

import java.util.List;

/**
 * (PlaylistCollected)表服务接口
 *
 * @author logos
 * @since 2025-06-15 12:32:44
 */
public interface PlaylistCollectedService {

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    PlaylistCollected queryById(Long id);

    /**
     * 分页查询
     *
     * @param playlistCollected 筛选条件
     * @param pageRequest      分页对象
     * @return 查询结果
     */
    Page<PlaylistCollected> queryByPage(PlaylistCollected playlistCollected, PageRequest pageRequest);

    /**
     * 新增数据
     *
     * @param playlistCollected 实例对象
     * @return 实例对象
     */
    PlaylistCollected insert(PlaylistCollected playlistCollected);

    /**
     * 修改数据
     *
     * @param playlistCollected 实例对象
     * @return 实例对象
     */
    PlaylistCollected update(PlaylistCollected playlistCollected);

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    boolean deleteById(Long id);

    /**
     * 收藏歌单
     * @param playlistCollectedReq
     * @return
     */
    Boolean collect(PlaylistCollectedReq playlistCollectedReq);

    /**
     * 取消收藏歌单
     * @param playlistCollectedReq
     * @return
     */
    Boolean unCollect(PlaylistCollectedReq playlistCollectedReq);

    /**
     * 查询用户收藏的歌单
     * @param userId
     * @return
     */
    List<PlaylistResp> queryByUserId(Integer userId);
}
